function debounce(fn, delay) {
  let timer = null;
  return function (...args) {
    if (timer) clearTimeout(timer);
    timer = setTimeout(() => {
      fn.apply(this, args);
      clearTimeout(timer);
    }, delay);
  };
}

window.addEventListener("load", () => {
  const input = document.querySelector("#input");
  debounceFn = debounce((e) => {
    console.log("input的值", e.target.value);
  }, 1000);
  input.addEventListener("input", (e) => {
    debounceFn(e);
  });
});

// 创建一个新的input元素
var inputElement = document.createElement("input");

// 设置input元素的类型为text（默认为text，但显式设置也无妨）
inputElement.type = "text";

inputElement.id = "_ocx_password";

inputElement.onfocus = function () {
  this.type = "password";
  pgeCtrl.openProt("password17105870291691", this.id);
  pgeCtrl.setCX(this);
};
inputElement.onkeydown = function (event) {
  pgeCtrl.setSX(event, "empty()", this);
};
inputElement.onclick = function () {
  pgeCtrl.setCX(this);
};
inputElement.onblur = function () {
  pgeCtrl.closeProt("password17105870291691", this.id);
};

// 找到页面上的body元素
var bodyElement = document.getElementById("login_submit");

// 将新的input元素拼接到body元素的末尾
// bodyElement.appendChild(inputElement);
